#include<bits/stdc++.h>

using namespace std;
struct student {
    string s;
    int a, b, c;
};

int main() {
    int n;
    cin >> n;
    student ve[n];
    for (int i = 0; i < n; i++) {
        cin >> ve[i].s;
        cin >> ve[i].a;
        cin >> ve[i].b;
        cin >> ve[i].c;
    }
    int mina = 0, minb = 0, minc = 0;
    for (int i = 1; i < n; i++) {
        if (ve[i].a < ve[mina].a)mina = i;
        if (ve[i].b < ve[minb].b)minb = i;
        if (ve[i].c < ve[minc].c)minc = i;
    }
    cout << "lower chinese:" << endl;
    for (int i = 0; i < n; i++)if (ve[i].a == ve[mina].a)cout << ve[i].s << "(" << ve[i].a << ")" << endl;
    cout << endl;
    cout << "lower math:" << endl;
    for (int i = 0; i < n; i++)if (ve[i].b == ve[minb].b)cout << ve[i].s << "(" << ve[i].b << ")" << endl;
    cout << endl;
    cout << "lower english:" << endl;
    for (int i = 0; i < n; i++)if (ve[i].c == ve[minc].c)cout << ve[i].s << "(" << ve[i].c << ")" << endl;
    cout << endl;
    cout << "lower score:" << endl;
    int sum = 0;
    int min = 300;
    for (int i = 0; i < n; i++) {
        sum = ve[i].a + ve[i].b + ve[i].c;
        if (sum <= min)min = sum;
    }
    for (int i = 0; i < n; i++) {
        if (ve[i].a + ve[i].b + ve[i].c == min)cout << ve[i].s << "(" << min << ")" << endl;
    }
    return 0;
}